<template>
	<view class="tool u-flex u-flex-wrap">
		<view class="li" @click="$navigateTo('/subPackages/product-coupon/index')"
			v-if="systemConfig.coupon_status == 1">
			<image :src="$getImageUrl('/user_client/static/images/user/lq.png')" mode="aspectFit" class="li-image">
			</image>
			<view class="li-text">领劵中心</view>
		</view>
		<!-- <view class="li" @click="$navigateTo('/subPackages/user/collection')">
			<image src="/static/images/user/sc.png" mode="aspectFit" class="li-image"></image>
			<view class="li-text">我的收藏</view>
		</view> -->
		<view class="li" @click="$navigateTo('/subPackages/boost/index')" v-if="systemConfig.boost_status == 1">
			<image :src="$getImageUrl('/user_client/static/images/user/0yuan.png')" mode="aspectFit" class="li-image">
			</image>
			<view class="li-text">0元试用</view>
		</view>
		<view class="li" @click="$navigateTo('/subPackages/complaint/list?type=20')">
			<image :src="$getImageUrl('/user_client/static/images/user/fk.png')" mode="aspectFit" class="li-image"></image>
			<view class="li-text">反馈建议</view>
			<view class="li-number" v-if="userInfo && Object.keys(userInfo).length > 0 && userInfo.feedback_unread_number != 0">
				{{userInfo.feedback_unread_number < 100?userInfo.feedback_unread_number:'99+'}}
			</view>
		</view>
		<view class="li" @click="$navigateTo('/subPackages/complaint/list?type=10')">
			<image :src="$getImageUrl('/user_client/static/images/user/ts.png')" mode="aspectFit" class="li-image"></image>
			<view class="li-text">问题投诉</view>
			<view class="li-number" v-if="userInfo && Object.keys(userInfo).length > 0 && userInfo.complaints_unread_number != 0">
				{{userInfo.complaints_unread_number < 100?userInfo.complaints_unread_number:'99+'}}
			</view>
		</view>
		<view class="li" @click="$navigateTo('/subPackages/integral-mail/index')">
			<image :src="$getImageUrl('/user_client/static/images/user/jf.png')" mode="aspectFit" class="li-image"></image>
			<view class="li-text">积分商城</view>
		</view>
		
	</view>
</template>
<script>
	import {
		mapState
	} from 'vuex'
	export default {
		name: "tool",
		data() {
			return {};
		},
		// 此处定义传入的参数
		props: {},
		computed: {
			...mapState({
				systemConfig: state => state.init.systemConfig,
				userInfo: state => state.user.userInfo
			})
		},
		mounted() {},
		methods: {}
	}
</script>
<style lang="scss" scoped>
	.tool {
		width: 100%;
		padding: 30rpx 30rpx 40rpx;
		margin-top: 25rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
		border-radius: 24rpx;
		// box-shadow: 0rpx 0rpx 15rpx 0rpx #f7f7f7;

		.li {
			width: 20%;
			position: relative;

			.li-image {
				width: 50rpx;
				height: 50rpx;
				display: block;
				margin: 0 auto;
			}

			.li-text {
				padding-top: 15rpx;
				line-height: 1;
				font-size: 22rpx;
				color: #020202;
				text-align: center;
			}
			
			.li-number {
				min-width: 28rpx;
				padding: 0 5rpx;
				height: 28rpx;
				line-height: 28rpx;
				position: absolute;
				top: -10px;
				right: 16px;
				border-radius: 100rpx;
				color: #FFFFFF;
				font-size: 18rpx;
				text-align: center;
				background-color: #CC242B;
				box-sizing: border-box;
			}
		}
	}
</style>